<?php
require('config.php');

        $user_id=$_REQUEST['user_id'];
		$sql="select * from `".$oto."_youhui_user_link`,`".$oto."_youhui` where ".$oto."_youhui_user_link.user_id='{$user_id}' and u_is_effect='1' and ".$oto."_youhui_user_link.youhui_id=".$oto."_youhui.id";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$youhui[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($youhui))
		{
			$sum=0;
			for($i=0;$i<count($youhui);$i++)
			{
				$max=$youhui[$i]['surplus'];
				for($j=0;$j<$max;$j++)
				{
					$data[$sum]=$youhui[$i];
					$sum++;
				}
			}
			echo json_encode($data);
		}
		else echo '[]';
		
?>